#include <AT89X52.H>
#include "typedef.h"

void InitTimer0(void)
{
    TMOD &= 0xF0;
    TMOD |= 0x01;
    ET0 = 1;
    TR0 = 1;
}

void InitKeyboard(void)
{
    P1 = 0xFF;
}

/* GM: 
 * @return: 1,key_pressd; 0, no key press.*/
int key1_pressd(void)
{
    if((P1 & 0x01) == 0){
        return 1; 
    }else{
        return 0;
    }
}
